package per.hx.bs.web.yw.service;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.*;
import per.hx.bs.entity.yw.YwSettlementDO;
import per.hx.bs.util.Query;

import java.util.List;
import java.util.Map;

/**
 * @author HuXing
 * @date 2018/4/30  19:02
 */
@Primary
@FeignClient(value = "Huxingbs-Sys-Service")
public interface YwSettlementService {
    /**
     * 结算
     *
     * @param userId     结算用户
     * @param settlement 结算时间
     * @param name       结算人名称
     * @return 影响行数
     */
    @PostMapping(value = "yw/settlement/{userId}")
    Integer settlement(@PathVariable("userId") Long userId, @RequestParam("settlement") String settlement, @RequestParam("name") String name);

    /**
     * 统计 部门结算
     *
     * @param map 调价
     * @return 结果
     */
    @PostMapping(value = "yw/settlement/listAsDept")
    List<YwSettlementDO> listAsDept(@RequestBody Map<String, Object> map);

    /**
     * 获取人员结算
     *
     * @param deptId     部门id
     * @param searchDate 时间
     * @return 结果
     */
    @GetMapping(value = "yw/settlement/listAsUser")
    List<YwSettlementDO> listAsUser(@RequestParam("deptId") Long deptId, @RequestParam("searchDate") String searchDate);

    /**
     * 通过id获取信息
     *
     * @param id id
     * @return 结果
     */
    @GetMapping(value = "yw/settlement/{id}")
    YwSettlementDO selectOne(@PathVariable("id") Long id);
}